package com.lab.common.enums;

public enum LabBorrowStatus {
    USE_AUTO(0, "待使用"), USING(1, "使用中"), END(2, "已结束"), CANCELED(3, "已取消");

    private final Integer code;
    private final String info;

    LabBorrowStatus(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static LabBorrowStatus getLabStatus(Integer code) {
        for (LabBorrowStatus labStatus : LabBorrowStatus.values()) {
            if (labStatus.getCode().equals(code)) {
                return labStatus;
            }
        }
        return USE_AUTO;
    }
}
